// filepath: /home/wf/codings/simu-board/src/BSP/Time.cpp
#include <BSP/Time.h>
#include <atomic>
#include <algorithm>

static std::atomic<uint8_t> g_hour{12};

extern "C" {
void time_init()
{
    g_hour.store(12, std::memory_order_relaxed);
}

void time_set_hour(uint8_t h)
{
    if (h > 24) h = 24;
    g_hour.store(h, std::memory_order_relaxed);
}

uint8_t time_get_hour()
{
    return g_hour.load(std::memory_order_relaxed);
}
}

